package cn.edu.zhku.util;

import cn.edu.zhku.pojo.User;
import org.apache.shiro.SecurityUtils;

public class ShiroUtil {

    public static Integer getUserId() {
        return getUser().getUserId();
    }

    public static String getUsername() {
        return getUser().getUsername();
    }

    public static User getUser() {
        return (User)SecurityUtils.getSubject().getPrincipal();
    }

}
